/* Watcher v1.00 by Case of Energy Telecommunications */
options results
if ~exists("sysdata:watcher.data") then call CREATE
arg z;reset=0;x=1;if z='SORT' then reset=1;tot=0;high=0;call open(subz,'sysdata:watcher.data',r);no=readln(subz)
name=z;do until x = (no+1);subname.x =readln(subz);if subname.x=name then reset=1;if reset=0 then do
if subname.x="xxx" then do;subname.x=name;reset=1;end;end;subno.x =readln(subz);tot=tot+subno.x;if subno.x>high then high=subno.x;x=x+1;end
call close(subz);if reset=0 then do;no=no+1;subname.no=name;subno.no=0;end
if z='RETRIEVE' then call RETRIEVE;x=1;if z='SORT' then call SORT;call open(subz,'sysdata:watcher.data',w);writeln(subz,no);do until x = (no+1)
if subname.x=name then subno.x=subno.x+1;writeln(subz,subname.x);writeln(subz,subno.x);x=x+1;end;call close(subz);exit
CREATE:
no=2;call open(start,'SYSDATA:watcher.data',w);writeln(start,no-1);do until x = (no+1);writeln(start,"xxx");writeln(start,0);x=x+1;end;call close(start);exit
SORT:
transmit "f1}n1}cf}z4} WATCHER v1.00 by Case z0}n2}cb}Generating Reportc7}: cf}00cd}% cb}completec7}."
y=0;do until y = grp;writech(pre,"±");y=y+1;end;writeln(pre,"z0}cf}");x=x+1;end;call close(pre);sendstring '$ sort from RAM:WATCHER.TEMP to SYSDATA:watcher.report NUMERIC}';sendstring '$ delete ram:watcher.temp}';sendfile 'sysdata:watcher.report';exit